package com.zdgk.core.web.controller.forward;

import com.zdgk.core.control.forward.network.IEC104Config;
import com.zdgk.core.control.read.modbus.cache.DeviceRegisterCacheResult;
import com.zdgk.core.web.common.CommonResult;
import com.zdgk.core.web.controller.forward.entity.IECStatusEntity;
import com.zdgk.core.web.controller.read.entity.ModbusStatusEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
public class IEC104Controller {

    @Resource
    private IEC104Config iec104Config;

    /**
     * 104 从站状态
     * @return
     */
    @GetMapping("/iec/status")
    public CommonResult<?> iecStatus(){
        IECStatusEntity iecStatusEntity = new IECStatusEntity();
        iecStatusEntity.setIsConnected(iec104Config.isConnected());
        return CommonResult.data(iecStatusEntity);
    }

}
